<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\datetime\DateTimePicker;
/* @var $this yii\web\View */
/* @var $model frontend\modules\resource\models\HyBookSearch */
/* @var $form yii\widgets\ActiveForm */
?>

<?php $this->registerJs(
    '$("document").ready(function(){ 
        $("#new_search").on("pjax:end", function() {
            $.pjax.reload({container:"#centerView"});  //Reload GridView
        });
    });'
);
?>
<?php yii\widgets\Pjax::begin(['id' => 'new_search']) ?>
<?php $form = ActiveForm::begin([
    'action' => ['index'],
    'method' => 'get',
    'options' => [
        'data-pjax' => 1
    ],
    'fieldConfig' => [
        'template' => '{label}：{input}',
    ],
]); ?>

<div style="overflow: hidden;">
<?= $form->field($model, 'start_time', ['options' => ['class' => 'search_input_date']])->widget(DateTimePicker::classname(), [
    'options' => ['placeholder' => '选择日期'],
    'pluginOptions' => [
        'format' => 'yyyy-mm-dd',
        'autoclose' => true,
        'startView' => 2,
        'minView' => 2,
        'maxView' => 2,
        'todayBtn' => true
    ]
]); ?>

<?= $form->field($model, 'end_time', ['options' => ['class' => 'search_input_date']])->widget(DateTimePicker::classname(), [
    'options' => ['placeholder' => '选择日期'],
    'pluginOptions' => [
        'format' => 'yyyy-mm-dd',
        'autoclose' => true,
        'startView' => 2,
        'minView' => 2,
        'maxView' => 2,
        'todayBtn' => true
    ]
]); ?>
</div>
<?= $form->field($model, 'res_code', ['options' => ['class' => 'search_input']]) ?>

<?= $form->field($model, 'res_title', ['options' => ['class' => 'search_input']]) ?>

<?= $form->field($model, 'author', ['options' => ['class' => 'search_input']]) ?>

<?= $form->field($model, 'keyword', ['options' => ['class' => 'search_input']]) ?>


<div class="form-group cha-xun">
    <?= Html::submitButton('检 索', ['class' => 'btn btn-primary']) ?>
</div>

<?php ActiveForm::end(); ?>
<?php yii\widgets\Pjax::end() ?>


